COM AT^SGDV - GPRS data volume
COM V1.0	04.01.2004	T. Kleinmann


from attglobals import *

AT^SGDV=?
WAIT FOR OK

while 1>0:
	# Get current GPRS volume data
	AT^SGDV=1
	strResp=WAITFOR (1,'OK')
	DataVol=ExtractParameter(strResp,1,'^SGDV:','')
	# Remove trailing 'OK' from response
	iDataVol=int((DataVol[:-2]).strip())
	# Check counter
	if iDataVol>0:
		MESSAGE('Current GPRS data volume is: ',iDataVol,chr(26),chr(10),'Press OK for resetting counter!')
		AT^SGDV=0
		WAIT FOR OK
		break
	elif iDataVol==0:
		MESSAGE('Please create GPRS data volume first!')
AT^SGDV=1
WAITFOR (1,'0')

AT
WAIT FOR OK


